home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / ddj0897.zip / RCSC.ZIP / LIB51 / REVERSE.C < prev    next >
C/C++ Source or Header  |  1997-01-12  |  184b  |  15 lines

  1. /*
  2. ** reverse string in place 
  3. */
  4. reverse(s) char *s; {
  5.   char *j;
  6.   int c;
  7.   j = s + strlen(s) - 1;
  8.   while(s < j) {
  9.     c = *s;
  10.     *s++ = *j;
  11.     *j-- = c;
  12.     }
  13.   }
  14.  
  15.